<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>订单列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>订单 —— 显示所有订单</small>
                    <a href="${pageContext.request.contextPath}/Admin/Menu" class="btn btn-danger" style="margin-left: 55%">退出</a>
                </h1>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4 column">
            <span class="glyphicon glyphicon-folder-open"></span>
            <a class="btn btn-primary" href="${pageContext.request.contextPath}/Admin/toAddOrder">新增</a>
        </div>
    </div>
    <div class="row" >
        <div class="col-md-4 column">
            <form action="${pageContext.request.contextPath}/Admin/query" method="post">
                <span class="glyphicon glyphicon-search"></span>
                <input type="text" placeholder="请输入订单编号" name="oid" >
                <button type="submit" class="btn btn-default" style="color: brown" >搜索</button>
            </form>
        </div>
    </div>
    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>订单编号</th>
                    <th>订单用户</th>
                    <th>商品编号</th>
                    <th>创建时间</th>
                    <th>状态</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach var="order" items="${requestScope.get('list')}">
                    <tr>
                        <td>${order.getOid()}</td>
                        <td>${order.getUid()}</td>
                        <td>${order.getPid()}</td>
                        <td>${order.getCreatTime()}</td>
                        <td>${order.getState()}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/Admin/toUpdateOrder?oid=${order.getOid()}">更改</a> |
                            <a href="${pageContext.request.contextPath}/Admin/del2/${order.getOid()}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</div>
